//
//  Header.h
//  VPDownloadManager
//
//  Created by vernepung on 16/3/15.
//  Copyright © 2016年 vernepung. All rights reserved.
//

#ifndef Header_h
#define Header_h
#import <UIKit/UIKit.h>
#import "PathMacro.h"
#import "Helper+Validate.h"

UIKIT_STATIC_INLINE NSString *getDownloadFolderPath(NSString *mainName){
    if (![Helper isBlankString:mainName]){
        return [[VPCachePath() stringByAppendingPathComponent:mainName] stringByAppendingPathComponent:@"vpDownFiles"];
    }
    return [VPCachePath() stringByAppendingPathComponent:@"vpDownFiles"];
};

UIKIT_STATIC_INLINE NSString *getConfigFilePath(NSString *mainName){
    return [getDownloadFolderPath(mainName) stringByAppendingPathComponent:@"config.dat"];
};

UIKIT_STATIC_INLINE NSString *getDownloadTempFolderPath(NSString *mainName){
    return [getDownloadFolderPath(mainName) stringByAppendingPathComponent:@"temp"];
};

UIKIT_STATIC_INLINE NSString *getDownloadFilesFolderPath(NSString *mainName){
    return [getDownloadFolderPath(mainName) stringByAppendingPathComponent:@"files"];
};

UIKIT_STATIC_INLINE NSString *getDownloadTempFilePath(NSString *mainName,NSString *tempFilePath){
    return [[getDownloadFolderPath(mainName) stringByAppendingPathComponent:@"temp"]stringByAppendingPathComponent:tempFilePath];
};

UIKIT_STATIC_INLINE NSString *getDownloadFilesPath(NSString *mainName,NSString *filePath){
    return [[getDownloadFolderPath(mainName) stringByAppendingPathComponent:@"files"]stringByAppendingPathComponent:filePath];
};
#endif /* Header_h */
